<template>
  <div>
    <!-- <div style="margin: 20px 0;">
            <Year :curData="curData" ref="resetCommon" @child="child"></Year>
        </div> -->
    <!-- <div>
            <date v-model="value" :type.sync="groupType" @handleChangeTime="handleChangeTime(type = 0, $event)"></date>

        </div> -->
    <div class="block">
      <span class="demonstration">默认</span>
      <el-date-picker
        v-model="value1"
        @change="changeValue"
        type="daterange"
        range-separator="至"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
      >
      </el-date-picker>
    </div>
  </div>
</template>

<script>
import date from "./day/date.vue";
import Year from "./Year";
//--------导入token
import { getToken } from "@/utils/auth";
export default {
  components: { Year, date },
  data() {
    return {
      value1: "",

      value: new Date(),
      groupType: "week",

      curData: {
        type: 1,
        dateRange: {
          beginTime: "",
          endTime: "",
        },
      },
      params: {
        queryType: 1,
        startDate: "",
        endDate: "",
      },
    };
  },
  mounted() {},
  methods: {
    changeValue() {
      console.log(JSON.stringify(this.value1));
    },
    handleChangeTime(type, timeObj) {
      console.log(type);
      console.log(timeObj);
      // TODO
    },

    child(objArgu, weekTime) {
      this.objArgu = objArgu;
      this.params.queryType = objArgu.cType;
      this.params.startDate = objArgu.beginTime;
      this.params.endDate = objArgu.endTime;
      this.weekTime = weekTime;
      console.log(JSON.stringify(this.params));
    },
  },
};
</script>
<style lang="scss" scoped></style>
